#pragma once
#include "MyGameDestopWindow.h"
#include "string"
#include "vector"
using namespace std;

#define MaxLineCount 8
#define MaxBytePerLine 25

enum SpeakerMsgType
{
	SMT_NULL = 0,
	SMT_Red,
	SMT_Green,
	SMT_Blue,
};

struct SpeakerMsg
{
	SpeakerMsgType Type;
	string PlayerName;
	string MsgText0;
	string MsgText1;
	int StartLineIndex;
	UINT CreateTime;
	UINT ShowTime;
	BOOL IsMouseOnPlayerName;
	int Alpha;
	SpeakerMsg()
	{
		Type = SMT_NULL;
		PlayerName = "";
		MsgText0 = "";
		MsgText1 = "";
		StartLineIndex = -1;
		CreateTime = 0;
		ShowTime = 0;
		IsMouseOnPlayerName = FALSE;
		Alpha = 255;
	}
};

class CSpeakerWindow : public CMyGameDesktopWindow
{
protected:
	vector<SpeakerMsg> m_vecSpeakerMsgShow;
	vector<SpeakerMsg> m_vecAllSpeakerMsg;
	int m_nTotalLineCount;
public:
	CSpeakerWindow(void);
	~CSpeakerWindow(void);
	
	BOOL OnCreate();

	void OnLBtnDown(int x,int y);
	void OnMouseMove(int x,int y);

	void Draw(HDC hDC);
	void Update();
	
	void AddSpeakerMsg(SpeakerMsgType MsgType,string strPlayerName,string strMsgText);
	void ClearAllMsgData();	
	void ClearMsgWnd();	

protected:	
	void DrawSpeakerMsg(HDC hDC,const SpeakerMsg& Msg);
	void UpdatePushBackMsg();
};
